import h5py
import altair as alt
import pandas as pd

f = h5py.File('out/dataset_order_submit.h5', 'r')
df = pd.DataFrame.from_dict(dict(ts=f['ts'][...], y1=f['y1'][...], y2=f['y2'][...]))
df['ts'] = pd.to_datetime(df['ts'], unit='ns')
df = df[df['y1'] >= 0]
df = df[df['y2'] >= 0]

alt.data_transformers.disable_max_rows()
chart = alt.Chart(df, width=800, height=600)
c1 = chart.encode(x='ts', y='y1').mark_circle() + chart.encode(x='ts', y='y1').mark_line()
c2 = chart.encode(x='ts', y='y2').mark_line(color='sky') + chart.encode(
    x='ts', y='y2').mark_circle(color='orange')
chart = alt.vconcat(c1.interactive(), c2.interactive())

import altair_viewer
altair_viewer._global_viewer._use_bundled_js = False

chart.show()
